package blueBridge;

import java.util.Scanner;

public class MainE {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        long res = 0;

        long pow = (long)Math.pow(a, b);

        for(long i = 1;i<pow;i++){
            if (huzhi(i,pow)) {
                res++;
                System.out.println(i+" "+ pow);
            }
        }
//        System.out.println(res%998244353);
    }

    private static boolean huzhi(long i, long pow) {
        for(int j = 2;j<=Math.sqrt(i)+1;j++){
            if(pow%j == 0&&i%j == 0) return false;
        }
        return true;
    }
}
